
import { login,loadStuInfoByStu } from "../../services/login"
export default {

  namespace: 'stuIndexModule',

  state: {
    loadStuInfoList:[]
  },

  effects: {
    *loginInfo({ payload }, { call, put }){
      return yield login(payload)
    },
    *loadStuInfo({ payload }, { call, put }) {
      let nav = yield loadStuInfoByStu(payload)
      yield put({
        type: 'loadStuInfoList', payload: nav
      });
    },

    
    *fetch({ payload }, { call, put }) {  // eslint-disable-line
      yield put({ type: 'save' });
    },
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
    loadStuInfoList(state, { payload }) {
      state.loadStuInfoList = payload;
      return {
        ...state,
        ...payload,
      }
  },
  },

};
